import pickle
import os
import numpy as np

try:
    inFile = open(os.path.join(os.path.curdir,'phoneClassifier.clf'),mode='rb')
    clf3 = pickle.load(inFile)
    phone = np.loadtxt("F:/机器学习数据集/phone_train.csv", skiprows=1, delimiter=',')
    X, y = phone[:, 0:19], phone[:, 20]
    print(X[:5], y[:5])
    res = clf3.predict(X[:5])
    print(res)
except Exception as e:
    print('错误',e)
finally:
    if inFile:
        inFile.close()


